#ifndef VENUS_UI_CONTROLLERS_EFFECT_CTRL_H
#define VENUS_UI_CONTROLLERS_EFFECT_CTRL_H

namespace venus {
enum CtrlResult { HANDLED, NO_EFFECT, EFFECTIVE };

class ScalarCtrlTriple{
 public:
  ScalarCtrlTriple(float start, float end, float step) 
      : start_(start), end_(end), step_(step) { }
  float dec(float old) const {
    float new_val = old - step_;
    if (new_val < start_) new_val = start_;
    return new_val;
  }
  float inc(float old) const {
    float new_val = old + step_;
    if (new_val > end_) new_val = end_;
    return new_val;
  }
 private:
  float start_, end_, step_;
};

class Effect;
class EffectCtrlGlut {
 public:
  virtual ~EffectCtrlGlut() = 0;
  /*
   * the following methods return true, if the relevant event is handled,
   * return false otherwise
   */
  virtual bool OnKeyboard(unsigned char key, int x, int y) { return false; }
  virtual bool OnSpecialKey(int key, int x, int y) { return false; }
  virtual bool OnMouse(int button, int state, int x, int y) { return false; }
  virtual const Effect *effect() const = 0;
};
} // namespace venus

#endif // VENUS_UI_CONTROLLERS_EFFECT_CTRL_H
